import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DeptStatisticalComponent } from './dept-statistical/dept-statistical.component';
import {StatisticalAnalysisComponent} from './statistical-analysis.component';
import {RouterModule, Routes} from '@angular/router';
import {LoginActivate} from '../../core/auth/login.activate';
import {NgZorroAntdModule} from 'ng-zorro-antd';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {ShareModule} from '../../share/share.module';
import { SchoolStatisticalComponent } from './school-statistical/school-statistical.component';

const routes: Routes = [
  {
    path: '',
    component: StatisticalAnalysisComponent,
    children: [
      {
        path: 'school-statistical',
        component: SchoolStatisticalComponent,
        data: {
          breadcrumb: '校级统计',
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'dept-statistical',
        component: DeptStatisticalComponent,
        data: {
          breadcrumb: '部门统计',
        },
        canActivate: [LoginActivate]
      },
      {
        path: '',
        redirectTo: 'dept-statistical',
        pathMatch: 'full'
      },
      {
        path: '**',
        component: DeptStatisticalComponent
      }
    ]
  }
];

@NgModule({
  declarations: [
    StatisticalAnalysisComponent,
    DeptStatisticalComponent,
    SchoolStatisticalComponent
  ],
  imports: [
    CommonModule,
    NgZorroAntdModule,
    FormsModule,
    ReactiveFormsModule,
    ShareModule,
    RouterModule.forChild(routes),
  ]
})
export class StatisticalAnalysisModule { }
